﻿@using System.Collections.ObjectModel;
@using BlueLotus7.SSQAnalysisCore;
@model BallCollection
<table class="history">
    <thead>
        <tr>
            <th class="title">
            </th>
            @{
                for (int i = 1; i <= Constant.RedBallQuantity; i++)
                {
                <text>
                <th class="red">
                    @(i.ToString("00"))
                </th>
                </text>
                }
                for (int i = 1; i <= Constant.BlueBallQuantity; i++)
                {
                <text>
                <th class="blue">
                    @(i.ToString("00"))
                </th>
                </text>
                }
            }
        </tr>
    </thead>
    <tbody>
        @{
            foreach (var one in Model)
            {
            <text>
            <td class="title">
                @(one.LotteryIdentity)
            </td>
            @{
                /// Red balls
                for (int i = 1; i <= Constant.RedBallQuantity; i++)
                {
                    var value = one.RedBalls[i];
                    if (value == 0)
                    {
                <text> <td class="red-hit">
                @(i.ToString("00"))
                </td>
                </text>
                    }
                    else
                    {
                <text> <td class="red">
                @(((int)value).ToString())
                </td>
                </text>
                    }

                }
                /// Blue balls
                for (int i = 1; i <= Constant.BlueBallQuantity; i++)
                {
                    var value = one.BlueBalls[i];
                    if (value == 0)
                    {
                <text> <td class="blue-hit">
                @(i.ToString("00"))
                </td>
                </text>
                    }
                    else
                    {
                <text> <td class="blue">
                @(((int)value).ToString())
                </td>
                </text>
                    }
                }
            }
            </tr>
            </text>
            }
        }
        </tr>
    </tbody>
</table>
